Skip to content

feat(flow-next): project strategy anchor + downstream grounding — 0.40.0#125

Merged
gmickel merged 1 commit intomainfrom
fn-39-project-strategy-strategymd-anchor
May 2, 2026
Merged

feat(flow-next): project strategy anchor + downstream grounding — 0.40.0#125
gmickel merged 1 commit intomainfrom
fn-39-project-strategy-strategymd-anchor

Conversation

@gmickel
Copy link
Copy Markdown
Owner

@gmickel gmickel commented May 2, 2026

Summary

  • Adds /flow-next:strategy — agent-native skill that writes/maintains a repo-root STRATEGY.md (problem, approach, personas, metrics, tracks). Mirror of CE 3.4's ce-strategy with flow-next adaptations (drop Marketing section, bare AskUserQuestion in canonical, lead-with-recommendation only on routing questions).
  • Wires STRATEGY.md grounding into 5 downstream skills as advisory read-only surfaces — prospect (Phase 0 scan + out-of-scope-vs-strategy rejection), plan (## Strategy Alignment + drift block), interview (autodetect + ## Strategy Conflicts), capture ([strategy:<track>] source tag + --override-strategy flag with decision-record prompt), plan-sync (drift surfacing, never auto-supersedes).
  • Adds R19 strategy-doc fluff guard (Tier 1 jargon — synergy / pivot / disrupt / thought-leadership / best-in-class / world-class / 10x); two-tier (canonical ci_test.sh + sync-codex.sh validation) — separate from R17 DDD guard.
  • Bumps version to 0.40.0; descriptions updated to 21 subagents / 17 commands / 22 skills; Codex mirror regenerated; mickel.tech feature card shipped (commit on main, pushed separately).

What's in this PR

Files What changed
plugins/flow-next/scripts/flowctl.py New cmd_strategy_status/read/list + parse/render/walk helpers; single-root walk (NOT nearest-ancestor like glossary)
plugins/flow-next/skills/flow-next-strategy/ New skill — SKILL.md + references/interview.md + references/strategy-template.md
plugins/flow-next/commands/flow-next/strategy.md Slash-command forwarder
plugins/flow-next/skills/flow-next-{prospect,plan,interview,capture,sync}/ Downstream STRATEGY.md grounding
plugins/flow-next/agents/plan-sync.md Strategy drift surfacing (read-only) + track-rename inline replacement
plugins/flow-next/scripts/ci_test.sh New section 5d — R19 strategy-doc fluff guard
scripts/sync-codex.sh flow-next-strategy registered in REQUIRED_OPENAI_YAML_SKILLS + workflow blue group + R19 mirror validation
plugins/flow-next/scripts/strategy_smoke_test.sh New — T1-T12 smoke (56 assertions, <5s)
Manifests + descriptions 0.40.0 across .claude-plugin / .codex-plugin / marketplace.json
Docs CHANGELOG / plugins/flow-next/README.md / CLAUDE.md / .flow/usage.md / root README.md
plugins/flow-next/codex/** Regenerated Codex mirror

Architectural calls baked in

  • Repo-root STRATEGY.md (peer of GLOSSARY.md / README.md) — survives .flow/ wipe, R18 invariant from glossary epic.
  • Single-root walk — strategy is repo-wide by Rumelt's definition; NOT nearest-ancestor like glossary (vocabulary is local; strategy is global).
  • Skill IS the editor — no flowctl strategy add/edit/remove. flowctl is read-only plumbing (status/read/list).
  • Foreign-file refusal in v1 via generator: flow-next-strategy frontmatter sentinel; multi-format migration deferred to v2.
  • Downstream advisory only — every consumer surfaces drift / conflicts read-only; never auto-supersedes the strategy doc.
  • Drop CE 3.4's Marketing section — over-rotated for OSS-tools repo (marketplace manifest IS the distribution surface).
  • Bare AskUserQuestion in canonical — sync-codex rewrites to request_user_input; no inline cross-platform tables polluting agent context.
  • Tier 1 forbidden vocab only — Rumelt's source uses "leverage" as a noun, false-positive risk too high. Separate guard from R17 DDD pattern (one purpose per block).

Test plan

  • strategy_smoke_test.sh — T1-T12 56/56 pass, 4.3s, refuses to run from main plugin repo
  • ci_test.sh — 57/57 pass (includes new R19 guard); fluff-fixture injection confirms guard fires non-zero on seeded synergy
  • smoke_test.sh — 130/130 pass (regression check)
  • glossary_smoke_test.sh — 80/80 pass (regression check)
  • sync-codex.sh — zero errors; Codex mirror has request_user_input substituted for AskUserQuestion; flow-next-strategy/agents/openai.yaml generated
  • All 3 manifests at 0.40.0 verified via jq
  • Plugin description counts refreshed (21/17/22)
  • mickel.tech feature card pushed to main (separate repo, commit 09ad184)

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: eb7d998705

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread plugins/flow-next/scripts/flowctl.py Outdated
Comment on lines +540 to +543
candidate = current / STRATEGY_FILE
try:
if candidate.is_file():
return candidate, repo_root
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Resolve strategy file only at repo root

find_strategy_file currently returns the first STRATEGY.md encountered while walking upward, so running from a subdirectory that contains its own STRATEGY.md will select that local file instead of the repo-root strategy. This reintroduces nearest-ancestor behavior that the new strategy design explicitly tries to avoid, and downstream consumers (strategy status/read/list and skills that call them) will ground on different strategy docs depending on cwd. In a monorepo or any repo with an accidental nested STRATEGY.md, this causes inconsistent planning/review behavior and false conflict/drift signals.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in dad66e3 — replaced the upward-walk loop in find_strategy_file with a direct check at repo_root / STRATEGY.md. STRATEGY_WALK_MAX_DEPTH stays as a dead constant for backward compat with any importer. New regression guard T3b in strategy_smoke_test.sh creates a fixture with both repo-root and apps/web/ STRATEGY.md, runs status from the subdir, and asserts resolution picks the repo-root file (verifies via name field round-trip).

gmickel added a commit to gmickel/mickel.tech that referenced this pull request May 2, 2026
…e-effect chain

The "When do I use prospect vs capture vs interview vs plan?" FAQ now covers all five upstream-of-work commands (added strategy as the most-upstream), shows (Strategy) as optional prefix on existing pathways, and explains that glossary terms + decision records accumulate as a side effect of /flow-next:interview --docs (no separate "build my glossary" route needed). Mirrors the README route-map updates from PR gmickel/flow-next#125.
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: bcf0bbd893

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread plugins/flow-next/scripts/flowctl.py Outdated
Comment on lines +593 to +594
if text == STRATEGY_HUSK_SENTINEL:
return False
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Treat unfinished strategy placeholders as unfilled sections

_strategy_section_filled only treats _Not currently tracking._ as empty, but /flow-next:strategy Phase 1.3 writes _Not yet captured._ into every unanswered required section during partial saves. In an interrupted first run, strategy status then reports those placeholder sections as populated, so sections_filled becomes non-zero (often 5) and downstream skills incorrectly enable strategy-aware grounding/conflict checks against placeholder text. This breaks the intended “resume first-run interview” and husk/signal gating behavior after mid-flow abandonment.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in dad66e3 — added STRATEGY_DRAFT_PLACEHOLDER = "_Not yet captured._" and a unified STRATEGY_EMPTY_SENTINELS frozenset that _strategy_section_filled consults; future sentinels add to the set rather than growing scattered if/elif checks. New regression guard T6b in strategy_smoke_test.sh creates a partial-save fixture with 2 populated + 3 placeholder sections and asserts sections_filled == 2 (not 5). All smoke + ci green.

gmickel added a commit that referenced this pull request May 2, 2026
…entinel (PR #125 review)

Two bugs surfaced by Codex review on PR #125:

P2 — find_strategy_file walked upward and returned the first STRATEGY.md
encountered, so a subdir with its own STRATEGY.md (intentional or
accidental) hijacked resolution. This is exactly the cascade the design
explicitly rejected (decision context: "single-root, NOT nearest-ancestor
like glossary — strategy is repo-wide by Rumelt's definition"). R7's spec
language was internally contradictory; worker implemented the literal
first half, not the design intent. Fix: replace the walk with a direct
check at repo_root / STRATEGY.md. STRATEGY_WALK_MAX_DEPTH stays as a dead
constant for backward compat with any importer; it has no effect.

P1 — _strategy_section_filled only treated _Not currently tracking._ as
empty, but the strategy skill writes _Not yet captured._ into every
unfilled required section during atomic per-section partial saves. After
mid-flow abandonment, sections_filled would inflate to 5 instead of
matching the answered-section count, falsely activating downstream
strategy-aware grounding against placeholder text. Fix: introduce
STRATEGY_DRAFT_PLACEHOLDER and a unified STRATEGY_EMPTY_SENTINELS frozenset
that _strategy_section_filled consults; future sentinels add to the set.

Smoke regression guards:
- T3b: subdir with its own STRATEGY.md is ignored (single-root)
- T6b: _Not yet captured._ placeholder excluded from sections_filled

ci_test 57/57, strategy_smoke 62/62, glossary_smoke 80/80, sync-codex green.
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: dad66e3e7c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +130 to +133
STRATEGY_AWARE=0
else
STRAT_FILLED=$("$FLOWCTL" strategy status --json 2>/dev/null | jq -r '.sections_filled // 0')
if [[ "${STRAT_FILLED:-0}" -ge 1 ]]; then
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Make --no-docs disable strategy-aware behavior too

The flag matrix in this skill says --no-docs should turn Glossary/Decisions/and Strategy off, but this block still auto-enables STRATEGY_AWARE from strategy status whenever sections_filled >= 1. In repos with a populated STRATEGY.md, /flow-next:interview --no-docs will still run behavior (e) and surface strategy-conflict questions/sections, which violates the documented override contract and user intent to disable doc-aware additions for that run.

Useful? React with 👍 / 👎.

- New /flow-next:strategy skill writes/maintains repo-root STRATEGY.md
  (peer of GLOSSARY.md / README.md). 5 required + 2 optional sections
  derived from Richard Rumelt's strategy kernel (diagnosis / guiding
  policy / coherent action) extended with persona + metrics for
  repo-doc utility
- Single-root resolution at repo root only (NOT nearest-ancestor like
  glossary — strategy is repo-wide by Rumelt's definition)
- flowctl strategy status / read / list — read-only plumbing; the
  skill IS the editor (no add/edit subcommands)
- Doc-aware autodetect extended with third condition
  (strategy.sections_filled >= 1); 5-row flag matrix where --docs /
  --no-docs cascade to all three categories and explicit --strategy /
  --no-strategy always wins over the cascade
- Downstream grounding in 5 skills: prospect (Phase 0 scan +
  out-of-scope-vs-strategy rejection), plan (## Strategy Alignment +
  drift block), interview (## Strategy Conflicts), capture
  ([strategy:<track>] source-tag + --override-strategy with
  decision-record prompt), plan-sync (drift surfacing, never
  auto-supersedes)
- R19 strategy-doc fluff guard (Tier 1: synergy / pivot / disrupt /
  thought-leadership / best-in-class / world-class / 10x); two-tier
  (canonical ci_test.sh section 5d + sync-codex.sh validation)
- Version bump 0.40.0; descriptions updated to 21 subagents /
  17 commands / 22 skills; Codex mirror regenerated
- Smoke test strategy_smoke_test.sh (T1-T12, 62 assertions, ~5s);
  CI matrix runs ci_test.sh on ubuntu/macos/windows
- Docs: CHANGELOG, root README, plugins/flow-next/README, CLAUDE.md,
  .flow/usage.md
@gmickel gmickel force-pushed the fn-39-project-strategy-strategymd-anchor branch from dad66e3 to c4cb09f Compare May 2, 2026 10:54
@gmickel gmickel merged commit b9fec73 into main May 2, 2026
3 checks passed
@gmickel gmickel deleted the fn-39-project-strategy-strategymd-anchor branch May 2, 2026 10:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant